<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" import="com.tangdi.Bean.*"%>
<%@ page language="java" import="com.tangdi.Utils"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<script language="javascript" type="text/javascript"
	src="My97DatePicker/WdatePicker.js"></script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>报表生成</title>
<style type="text/css">
h1 {font-family:Georgia;}
.rs_success{position:relative; 
             top:30px; left:20px;
             color:green; 
             font-weight:bold; 
             font-size:20px
             }
.rs_error{position:relative; 
             top:30px; left:20px;
             color:red; 
             font-weight:bold; 
             font-size:20px
             }
</style>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script type="text/javascript">
		function data_import(){
			var form = document.getElementById('data_import');
			var year_month = form.year_month.value;
			if(year_month !=""){
			   form.action="GZ_Report_CreateAction?type=2";
			   }
			else{
			     alert("年月不能为空");
			     return;
			     }
			}
	</script>
</head>
<jsp:include page="header.jsp"></jsp:include>
<body>
	<form onSubmit="return data_import()" method="post" id="data_import">
		<table>
			<tr>
				<td width="70" style="text-align:right">年月：</td>
				<td width="70"><input class="Wdate" type="text" required="true" 
					name="year_month" onfocus="WdatePicker({dateFmt:'yyyyMM'})"
					value="${year_month}" /></td>
					
				<td width="50"></td>
				<td width="70">
					<select name="create_type">
                      <option value="0" selected="selected">生成Pdf文件</option>
                      <option value="1">生成Excel文件</option>
                      <option value="2">生成所有文件</option>
             		</select>
				</td>
				<td width="70"></td>
				<td><input type="submit" value="生成报表" /></td>
			</tr>
		</table>
	</form>

 	<% 
 		String return_result =  (String)session.getAttribute("return_result");
	    String year_month = (String)session.getAttribute("year_month");
	    String cr_status = (String)session.getAttribute("cr_status");
	    
	%>
	<% 
	if(return_result != null && cr_status.equals("0")){
	%>
	<p><span class = "rs_success"><%=return_result%></span></p>
	<%
	}else if(return_result != null && !(cr_status.equals("0"))){
		%>
		<p><span class = "rs_error"><%=return_result%></span></p>
		<%
	}else{
	%>
	<p></p>
	<% }
   	%>
</body>
</html>
